# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Samuel Littley <aur@toastwaffle.com>
# Contributor: rnons <remotenonsense at gmail dot com>

_pkg=ruamel.yaml.clib
pkgname=python-$_pkg
pkgver=0.2.7
pkgrel=2
pkgdesc="C version of reader, parser and emitter for ruamel.yaml derived from libyaml"
arch=('loong64' 'x86_64')
url="https://sourceforge.net/projects/ruamel-yaml-clib/"
license=('MIT')
depends=('python')
makedepends=('python-setuptools')
source=(https://files.pythonhosted.org/packages/source/r/${_pkg}/${_pkg}-${pkgver}.tar.gz)
sha512sums=('b752b17ddf5da99fa6ee18b0ed1836da9a5c3dc58ab8b326d7aa97f6e4daadb298a2f149d79a650ab0326f52873aee6b1bc68cdaeb59465b4fafce49553ce69e')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

package() {
  cd ${_pkg}-${pkgver}
  # https://bitbucket.org/ruamel/yaml/issues/114/setuppy-requirement-for-pip-prevents
  RUAMEL_NO_PIP_INSTALL_CHECK=1 python setup.py install --skip-build --root="${pkgdir}" --optimize=1
  install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
